package com.liu.community.mapper;/*
 *@Author:Liu Xing-zhi
 *Description:
 *Date:Crated in 11:23 2021/10/8
 */

import com.liu.community.pojor.Question;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface QuestionMapper {

      void createQuestion(Question question);
    //分页查询数据
     List<Question> queryAllQuestion(@Param("tagLike")String tagLike,@Param("search")String search,@Param("begin")Integer begin,@Param("pageSize")Integer pageSize);

    //查询总记录数
     Integer queryDataTotalCount(@Param("tagLike")String tagLike,@Param("search")String search);

    List<Question> queryAllQuestionById(@Param("userId")Integer userId, @Param("begin")Integer begin,@Param("pageSize")Integer pageSize);

    Integer queryDataTotalCountByUserId(@Param("userId")Integer userId);

    Question queryQuestionById(@Param("id")Integer id);

    Integer update(Question question);

    void updateViewCount(Question updateQuestion);

    Integer updateCommentCount(@Param("id") Integer id,@Param("commentCount") Integer commentCount);

    List<Question> queryRelated(Question question);

}
